#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <set>
using namespace std;
class Solution
{
public:
    int findMaxConsecutiveOnes(vector<int> &nums)
    {
        int i = 0, j = 0, ans = 0;
        while (j < nums.size())
        {
            while (j < nums.size() && nums[j] != 0)
                j++;
            ans = max(j - i, ans);
            i = ++j;
        }
        return ans;
    }
};